<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/index3.css">
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/jquery-3.2.1.js"></script>
    <script src="${pageContext.request.contextPath}/static/My97DatePicker/WdatePicker.js"></script>
</head>

<body>
<form method="post">
账号:<input type="text" name="zhanghao" value="${zhu.zhanghao}" readonly><br>
显示名称:<input type="text" name="xianming" value="${zhu.xianming}" readonly><br>
真实姓名:<input type="text" name="zhengming" value="${zhu.zhengming}" readonly><br>
头像:<img src="/pic/${zhu.img}" width="100px" height="100px">
身份证号:<input type="text" name="card" value="${zhu.card}" onblur="sf()" readonly><br>
年龄:<input type="text" name="age" value="${zhu.age}" readonly><br>
手机号1:<input type="text" name="phone1" value="${zhu.phone1}" readonly><br>
手机号2:<input type="text" name="phone2" value="${zhu.phone2}" readonly><br>
注册日期:<input type="text" name="date" value='<fmt:formatDate value="${zhu.date}" pattern="yyyy-MM-dd"></fmt:formatDate>' readonly><br>
    <h1>登录详情</h1>
    <table>
        <tr>
            <td>公网ip</td>
            <td>登录区域</td>
            <td>登录时间</td>
        </tr>
        <c:forEach items="${zhu.details}" var="s">
            <tr>
                <td>${s.ip}</td>
                <td>${s.eare}</td>
                <td><fmt:formatDate value='${s.time}' pattern="yyyy-MM-dd"></fmt:formatDate></td>
            </tr>
        </c:forEach>
    </table>
</form>
<script>
    $(function () {
        sf();
    })
    function sf() {
        var card=$('[name="card"]').val();
        var nian=card.substring(6,10);
        alert(nian)
        var date=new Date();
        var date1= new Date(nian);
        $('[name="age"]').val(date.getFullYear()- date1.getFullYear());
    }
</script>
</body>
</html>
